<template>
    <view>
     <u-navbar :is-back="true" title="昵称修改" back-text="">
      <view
        class="slot-right"
        style="width: 100%; display: flex; justify-content: flex-end"
      >
        <view  @click="submitM" style="padding: 0rem 0.5rem;display: flex;
align-items: center;">
            <view style="
font-size: 0.75rem;
font-family: PingFang SC;
font-weight: 300;
color: #02AF74;" >确认</view>

            <!-- <image style="width: 0.7rem;
height: 0.5rem;
padding: 0.3rem;" src="../../../style/image/my/bottomArrow.jpg" alt=""> -->
        </view>
      </view>
    </u-navbar>

        <view  class="modifyNameP" >
                     
      <view class="modifyName"  style="" >
       <u-input v-model="value" :type="type" :border="border"  />
      </view>

        </view>
 

      
    </view>
</template>

<script lang='ts' >

 import { Component, Prop,Vue, Watch ,Emit} from 'vue-property-decorator'

import { saveUserInfo } from "../../utils/uniApi";

 @Component({     //   @Component  是一个装修器   不可以在下面写语句
        name: 'test',
    })


    export default class extends Vue {
 
     @Prop({
            type: String, // 父组件传递给子组件的数据类型
            required: false, // 是否必填
            default: ' ' // 默认值， 如果传入的是 Object，则要 default: ()=>({}) 参数为函数
        }) msg!:string;


        value=''
				type= 'text'
				passwordIcon= true
				border= false
       
         created() {
          }

          mounted() {
              //  console.log('父组件传递的参数:',this.$parent)   //暂时不考虑
          }

          submitM(){

               let params = {
              userId:
                uni.getStorageSync("userId") == ""
                  ? ""
                  : parseInt(uni.getStorageSync("userId")),
              nickName: this.value,
            };

            saveUserInfo(params).then((res:any) => {
              uni.showToast({
                title: res.data.message,
                icon: "none",
                duration: 2000,
              });
            });

          
          }

     
    }
</script>

<style  scoped>
.modifyNameP{
background-color: #f4f5f7;
height: 100vh;

}

.modifyName{
background-color: white;
}
</style>